package com.ktkj.init.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ktkj.init.entity.UserRoleMapping;
import com.ktkj.init.mapper.UserRoleMappingMapper;
import com.ktkj.init.service.UserRoleMappingService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户与角色映射表 服务实现类
 * </p>
 *
 * @author ktkj
 * @since 2021-12-31
 */
@Service
public class UserRoleMappingServiceImpl extends ServiceImpl<UserRoleMappingMapper, UserRoleMapping> implements UserRoleMappingService {

    @Override
    public List<UserRoleMapping> getByUserId(Long userId) {
        QueryWrapper<UserRoleMapping> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id", userId);
        return list(wrapper);
    }
}
